public class Account {
        private long sotaikhoan;
        private String tentaikhoan;
        private double sotien;
        private String kieutien;
        final double laisuat=0.02;
        
        public Account()
        {
                
        }
        public Account(long sotk,String tentk,double sotien1)
        {
                sotaikhoan=sotk;
                tentaikhoan=tentk;
                sotien=sotien1;
        }
        public Account(long sotk,String tentk)
        {
                sotaikhoan=sotk;
                tentaikhoan=tentk;
                sotien=100;
        }
        //biet set get cho sotaikhoan 
        public void setsotk(long sotk)
        {
                sotaikhoan=sotk;
        }
        public long getsotk()
        {
                return sotaikhoan;
        } 
        public void settentk(String tentk)
        {
                tentaikhoan=tentk;
        }
        public String gettentk()
        {
                return tentaikhoan;
        }
        public void setsotien(double sotien1)
        {
                sotien=sotien1;
        }
        public double getsotien() 
        {
                return sotien;
        }
        public void toString(String tiente)
        {
                kieutien=tiente;
                System.out.println("So tai khoan cua ban la "+sotaikhoan);
                System.out.println("Ten tai khoan cua ban la "+tentaikhoan);
                System.out.println("So tien trong tai khoan cua ban la "+sotien+kieutien);              
        }
        public void naptien(double sotiennap)
        {
                sotien=sotien+sotiennap;
        }
        public void ruttien(double sotienrut,double phirut)
        {       
                if(sotien>sotienrut+phirut)
                sotien=sotien-(sotienrut+phirut);
        }
        public void daohan()
        {
                sotien=sotien+(sotien*laisuat);
        }
        public void chuyenkhoan(Account y,double sotienchuyen,double phi)
        {
                ruttien(sotienchuyen,phi);
                y.naptien(sotienchuyen);
        }
        public static void main(String[] args)
        {
                Account x=new Account();
                x.setsotk(123456);
                x.settentk("hoat");
                x.setsotien(600);
                x.toString("USD");
                Account y=new Account(123, "acb");
                y.toString("USD");
                x.chuyenkhoan(y, 400, 30);
                System.out.println("Tai khoan sau khi chuyen");
                x.toString("USD");
                y.toString("USD");
        }
}

